home *** CD-ROM | disk | FTP | other *** search
- PXFISBLK(3F) Last changed: 1-22-99
-
-
- NNAAMMEE
- PPXXFFIISSBBLLKK - Tests for block special file
-
- SSYYNNOOPPSSIISS
- LLOOGGIICCAALL FFUUNNCCTTIIOONN PPXXFFIISSBBLLKK((_m))
- IINNTTEEGGEERR _m
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- SSTTAANNDDAARRDDSS
- IEEE standard interface for FORTRAN 77
-
- DDEESSCCRRIIPPTTIIOONN
- On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
- default when compiling programs with the MIPSpro 7 Fortran 90 compiler
- or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
- F77 compiler.
-
- The logical function PPXXFFIISSBBLLKK checks if a file is a block special
- file. The argument _m should be supplied by the sstt__mmooddee component of
- the ssttaatt structure used by the PPXXFFSSTTAATT(3F) routine.
-
- When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
- UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
- kind unless documented otherwise. On UNICOS and UNICOS/mk, default
- kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
- IRIX, the default kind is KKIINNDD==44.
-
- The following argument is valid for this routine:
-
- _m An integer input variable containing the file mode.
-
- If the file is a block special file, PPXXFFIISSBBLLKK returns a logical true,
- otherwise a logical false is returned.
-
- EEXXAAMMPPLLEESS
- In this example, the //ddeevv//ddsskk directory is read until a block special
- file is found or the end of the directory is reached. If a block
- special file is found, the file is printed.
-
- program pxftest
- integer ierror,mode,ilen,EEND
- integer idirid,jdirent,jstat
- logical PXFISBLK, found
- character*30 name, path
-
- CALL PXFSTRUCTCREATE('dirent',jdirent,ierror)
- CALL PXFSTRUCTCREATE('stat',jstat,ierror)
- CALL PXFCONST('EEND',EEND,ierror)
- path = '/dev/dsk'
- found = .FALSE.
- CALL PXFOPENDIR(path,0,idirid,ierror)
- CALL PXFCHDIR(path,0,ierror)
- do while (found .eqv. .FALSE.)
- CALL PXFREADDIR(idirid,jdirent,ierror)
- if (ierror .eq. EEND) then
- exit
- endif
- CALL PXFSTRGET(jdirent,'d_name',name,ilen,ierror)
- CALL PXFSTAT(name,0,jstat,ierror)
- CALL PXFINTGET(jstat,'st_mode',mode,ierror)
- if (PXFISBLK(mode)) then
- found = .TRUE.
- endif
- enddo
-
- if (found .eqv. .TRUE.) then
- print *,name,' is a block file.'
- endif
- end
-
- SSEEEE AALLSSOO
- PPXXFFCCOONNSSTT(3F), PPXXFFIINNTTSSEETT(3F), PPXXFFSSTTRRUUCCTTCCRREEAATTEE(3F)
-
- _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed
- version of this man page.
-